package org.airline.entity;


import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class Flight {
	private int id; // 自增ID
	private String flight_name; // 航班名称
	private String flight_type; // 机型
	private int capacity; // 容纳人数
	private String start_flight; // 起飞地点
	private String end_flight; // 降落地点
	private int times; // 航班旅程
	private double price; // 价格
	private List<FlightArrange> flightArrangeList;

	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getStart_flight() {
		return start_flight;
	}

	public void setStart_flight(String startFlight) {
		start_flight = startFlight;
	}

	public String getEnd_flight() {
		return end_flight;
	}

	public void setEnd_flight(String endFlight) {
		end_flight = endFlight;
	}

	public int getTimes() {
		return times;
	}

	public void setTimes(int times) {
		this.times = times;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public int getCapacity() {
		return capacity;
	}

	public void setCapacity(int capacity) {
		this.capacity = capacity;
	}

	public String getFlight_name() {
		return flight_name;
	}

	public void setFlight_name(String flight_name) {
		this.flight_name = flight_name;
	}

	public String getFlight_type() {
		return flight_type;
	}

	public void setFlight_type(String flightType) {
		flight_type = flightType;
	}
	
	@OneToMany(mappedBy = "flight", cascade = CascadeType.ALL)
	public List<FlightArrange> getFlightArrangeList() {
		return flightArrangeList;
	}

	public void setFlightArrangeList(List<FlightArrange> flightArrangeList) {
		this.flightArrangeList = flightArrangeList;
	}

}
